package com.yc.tomcat.impl;

import com.yc.tomcat.HttpServletRequest;
import com.yc.tomcat.HttpServletResponse;
import com.yc.tomcat.ServletException;

import javax.servlet.annotation.WebServlet;
import java.io.IOException;
import java.io.PrintWriter;


//like.s?like=看电影&like=玩手机&like=打球
@WebServlet("like.s")
public class LikesServlet extends HttpServletImpl {
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        String[] likes = request.getParameterValues("like");
        response.setContentType("text/html;charset=utf-8");
        PrintWriter out=response.getWriter();
        out.println("<ul>");
        for (String like : likes) {
            out.println("<li>");
            out.println(like);
            out.println("</li>");
        }
        out.println("</ur>");
    }
}
